<template>
  <div class="main">
    <el-container class="main-container">
      <el-aside :width="isCollpase ? '60px' : '210px'">
        <nav-menu :collapse="isCollpase" />
      </el-aside>
      <el-container class="page">
        <el-header>Header</el-header>
        <el-main class="page-content">
          <div class="page-info">
            <router-view></router-view>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts">
import navMenu from '@/components/nav-menu'
import { defineComponent, ref } from 'vue'

export default defineComponent({
  components: { navMenu },
  setup() {
    const isCollpase = ref(false)

    const handleFoldChange = (isFold: boolean) => {
      isCollpase.value = isFold
    }
    return {
      isCollpase,
      handleFoldChange
    }
  }
})
</script>

<style lang="less" scoped>
.main {
  position: fiexd;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.main-content,
.page {
  height: 100%;
}

.page-content {
  height: calc(100% - 48px);

  .page-info {
    background-color: #fff;
    border-radius: 5px;
  }
}

.el-header,
.el-footer {
  display: flex;
  color: #333;
  text-align: center;
  align-items: center;
}

.el-header {
  height: 48px !important;
}

.el-aside {
  background-color: #d3dce6;
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 160px;
}
</style>
